package com.hotel.main.entity;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import com.hotel.main.entity.enums.Gender;

@MappedSuperclass
public abstract class AbstractPerson extends AbstractEntity{
	private static final long serialVersionUID = 2235835830645631807L;
	
	@Column(name = "first_name", length = 15)
	private String firstName;
	
	@Column(name = "middle_name")
	private String middleName;
	
	@Column(name = "last_name", length = 15)
	private String lastName;
	
	@Column(name = "user_name", length = 15, nullable = false, unique = true)
	private String userName;
	
	@Column(name = "email", length = 50, nullable = false, unique = true)
	private String email;
	
	@Column(name = "password", length = 15, nullable = false)
	private String password;
	
	@Column(name = "current_address", length = 50)
	private String currentAddress;
	
	@Column(name = "country", length = 15)
	private String country;
	
	@Column(name = "city", length = 15)
	private String city;
	
	@Column(name = "province", length = 15)
	private String province;
	
	@Column(name = "postCode")
	private Integer postCode;
	
	@Column(name = "birth_of_date")
	@Temporal(TemporalType.DATE)
	private Date birthOfDate;
	
	@Column(name = "phone", length = 24)
	private String phone;
	
	@Column(name = "passport_serial_number", length = 20, unique = true)
	private String passportSerialNumber;
	
	@Column(name = "gender")
	@Enumerated(EnumType.STRING)
	private Gender gender;
	
	@Column(name = "description", length = 255)
	private String description;
	
	@Column(name = "updated")
	@Temporal(TemporalType.TIMESTAMP)
	private Date updated;

	@Override
	public String toString() {
		return this.getClass().getSimpleName() + " id:" + getId();
	}	
	
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setMiddleName(String middleName) {
		this.middleName = middleName;
	}

	public String getMiddleName() {
		return middleName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserName() {
		return userName;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getEmail() {
		return email;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPassword() {
		return password;
	}

	public void setBirthOfDate(Date birthOfDate) {
		this.birthOfDate = birthOfDate;
	}

	public Date getBirthOfDate() {
		return birthOfDate;
	}

	public void setCurrentAddress(String currentAddress) {
		this.currentAddress = currentAddress;
	}

	public String getCurrentAddress() {
		return currentAddress;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getCountry() {
		return country;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCity() {
		return city;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getProvince() {
		return province;
	}

	public void setPostCode(Integer postCode) {
		this.postCode = postCode;
	}

	public Integer getPostCode() {
		return postCode;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPhone() {
		return phone;
	}
	
	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public Gender getGender() {
		return gender;
	}
	
	public void setDescription(String description) {
		this.description = description;
	}

	public String getDescription() {
		return description;
	}

	public void setPassportSerialNumber(String passportSerialNumber) {
		this.passportSerialNumber = passportSerialNumber;
	}

	public String getPassportSerialNumber() {
		return passportSerialNumber;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	public Date getUpdated() {
		return updated;
	}
}
